public class SetCheck {
	
	private int a = 0;
	private int b = 0;
	
	void set(){
		a = 1;
		b = -1;
	}
	
	boolean check(){
		return ((a==0)&&(b==0)) ||( (a==1) &&(b==-1));
	}

}

class CheckThread extends Thread{
	SetCheck sc;
	
	public CheckThread(SetCheck sc){
		this.sc = sc;
	}
	
	public void run(){
		boolean rst = sc.check();
		if(rst != true){
			throw new RuntimeException("bug found");
		}
	}
		
	public static void main(String[] args){
		SetCheck sc = new SetCheck();
		new CheckThread(sc).start();
		new SetThread(sc).start();
	}
}

class SetThread extends Thread{
	SetCheck sc;
	
	public SetThread(SetCheck sc){
		this.sc = sc;
	}
	
	public void run(){
		sc.set();
	}
}
